import { LEFT_KEY, RIGHT_KEY } from "./constant";

const keyboard = {
  bindEvent(obj) {
    document.addEventListener(
      "keyup",
      (e) => {
        if (e.keyCode === LEFT_KEY) {
          obj.prev();
        } else if (e.keyCode === RIGHT_KEY) {
          obj.next();
        }
      },
      false
    );
  },
};

export default keyboard;
